﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xtee.Core
{
    public class Storage
    {
        public Storage(string messagePathFormat,bool storeMessages,string main, string temp) {
            this.StoreMessages = storeMessages;
            this.MessagePathFormat = messagePathFormat;
            this.MainRoot = main;
            if (string.IsNullOrEmpty(temp)) {
                temp = main;
            }
            this.TempRoot = temp;
        }

        public bool TempInMemory { get { return this.TempRoot == InMemory; } }

        public const string InMemory = ":inmemory:";

        public string MainRoot { get; private set; }
        public string TempRoot { get; private set; } 
        public string MessagePathFormat { get; private set; }
        public bool StoreMessages { get; private set; }

        public void LoadTemporaryFilesInMemory()
        {
            this.TempRoot = InMemory;
        }
    }
}
